#ifndef __VOL_NAMEDPIPE_WRAPPER_H__
#define __VOL_NAMEDPIPE_WRAPPER_H__

class CNamedPipeWrapper
{
private:
    HANDLE m_hPipe;

public:
    CNamedPipeWrapper();
    ~CNamedPipeWrapper();
    void Close();
    BOOL Create(LPCTSTR lpName, DWORD dwBufferSize);
    BOOL Connect(LPCTSTR lpName, LPCTSTR lpHostName, INT nMaxWaitMillseconds);
    BOOL ConnectNamedPipe();
    BOOL Read(LPVOID lpBuffer, DWORD dwBufferSize, LPDWORD lpNumberOfBytesRead);
    BOOL Write(LPCVOID lpBuffer, DWORD dwBufferSize, LPDWORD lpNumberOfBytesWritten);
    BOOL DisconnectNamedPipe();
    DWORD GetPipeBufSize();
};
#endif //__VOL_NAMEDPIPE_WRAPPER_H__